﻿<%@ Page Language="C#" MasterPageFile="~/WebSite/manager.Master" AutoEventWireup="true" CodeFile="m_data_judgelevel.aspx.cs" Inherits="WebSite_m_data_judgelevel" Title="无标题页" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <style type="text/css">
        .InfoStyle
        {
        	margin:25px;
        	margin-left:0px;
        	width:650px;
        	overflow:visible;
       	}
       	.InfoStyle h1
       	{
       		font-size:20px;
       		background-image:url(../images/Clip.png);
       		background-repeat:no-repeat;
       		width:300px;
       		margin:-23px auto auto 180px;
       		padding-top:15px;
       		padding-left:50px;
       		height:40px;
       	}
       	.InsertBtnStyle
       	{
       		margin:5px 200px auto;
    	    width:90px;
    	    height:30px;
    	    background-color:#669DF0;
    	    font-size:16px;
    	    font-weight:bold;
    	    color:#FFFFFF;
       	}
       	.TableStyle
       	{
       		margin:0px 25spx;
       	}
    </style>
    <div class="InfoStyle">
        <h1>体测结果评价信息表</h1>
        <br />
        <div class="TableStyle">
        <asp:GridView ID="UserDetailGridView" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False"  DataKeyNames="TestName,Sex,Level"
            DataSourceID="SqlDataSource1" CellPadding="4" Font-Size="15px" 
                                        PageSize="10" ForeColor="#333333" GridLines="None">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" VerticalAlign="Middle" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="TestName" HeaderText="项目名称" 
                    SortExpression="TestName" ItemStyle-Width="120px" 
                    ControlStyle-Width="100px"  >
<ControlStyle Width="100px"></ControlStyle>

<ItemStyle Width="120px"></ItemStyle>
                </asp:BoundField>
                <asp:TemplateField HeaderText="性别" SortExpression="Sex">
                    <ItemTemplate>
                        <asp:DropDownList runat="server" ID="SexDropDownList" 
                            SelectedValue='<%# Bind("Sex", "{0}") %>'>
                            <asp:ListItem Value="False">男</asp:ListItem>
                            <asp:ListItem Value="True">女</asp:ListItem>
                        </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Level" HeaderText="等级" 
                    SortExpression="Level" ControlStyle-Width="50px" ItemStyle-Width="50px">
<ControlStyle Width="50px"></ControlStyle>

<ItemStyle Width="50px"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="JudgeInfo" HeaderText="评价信息" 
                    SortExpression="JudgeInfo" ControlStyle-Width="300px" 
                    ItemStyle-Width="300px">
<ControlStyle Width="300px"></ControlStyle>

<ItemStyle Width="300px"></ItemStyle>
                </asp:BoundField>
            </Columns>
            <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <br />
        <table style="font-size:15px; text-align:center; margin-left:0px;">
            <tr>
                <td>项目名称</td>
                <td>等级</td>
                <td>性别</td>
                <td>评价信息</td>
            </tr>
            <tr>
                <td>
                     <asp:DropDownList ID="TestNameDropDownList" runat="server" style="width:90px;" 
                        DataSourceID="SqlDataSource2" DataTextField="TestName" 
                        DataValueField="TestName"></asp:DropDownList>
                </td>
                <td>
                    <asp:TextBox ID="LevelTextBox" runat="server" EnableViewState="False" Wrap="False" Width="50px" MaxLength="5"/>
                </td>
                <td>
                    <asp:DropDownList ID="SexDropDownList" runat="server">
                        <asp:ListItem Value="0">男</asp:ListItem>
                        <asp:ListItem Value="1">女</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:TextBox ID="JudgeTextBox" runat="server" style="width:400px"  />
                </td>
           </tr>
        </table>
        <asp:Button ID="InsertBtn" runat="server" Text="插入信息" OnClick="InsertBtn_Click" 
                CssClass="InsertBtnStyle"/>
    </div> 
            
  <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:CSHDBConnectionString %>" 
            
        SelectCommand="SELECT [TestName], [Sex], [Level], [JudgeInfo] FROM [JudgeInfoTable]" 
        DeleteCommand="DELETE FROM [JudgeInfoTable] WHERE [TestName] = @original_TestName AND [Sex] = @original_Sex AND [Level] = @original_Level"  
        
        UpdateCommand="UPDATE [JudgeInfoTable] SET [JudgeInfo] = @JudgeInfo WHERE [TestName] = @original_TestName AND [Sex] = @original_Sex AND [Level] = @original_Level" 
        InsertCommand="INSERT INTO [JudgeInfoTable] ([TestName], [Sex], [Level], [JudgeInfo]) VALUES (@TestName, @Sex, @Level, @JudgeInfo)" 
        OldValuesParameterFormatString="original_{0}" >
            <DeleteParameters>
                <asp:Parameter Name="original_TestName" Type="String" />
                <asp:Parameter Name="original_Sex" Type="Boolean" />
                <asp:Parameter Name="original_Level" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="JudgeInfo" Type="String" />
                <asp:Parameter Name="original_TestName" Type="String" />
                <asp:Parameter Name="original_Sex" Type="Boolean" />
                <asp:Parameter Name="original_Level" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="TestName" Type="String" />
                <asp:Parameter Name="Sex" Type="Boolean" />
                <asp:Parameter Name="Level" Type="String" />
                <asp:Parameter Name="JudgeInfo" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        
        
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:CSHDBConnectionString %>" 
            SelectCommand="SELECT LTRIM(RTRIM(TestName)) AS TestName FROM TargetCatagory WHERE (ItemCatagory &lt;&gt; '奖惩项目') AND CHARINDEX('米',TestName)=0">
        </asp:SqlDataSource>
        
        
</div>

    <asp:Label ID="WarnLabel" runat="server" ForeColor="Red" Visible="false" /> 
</asp:Content>

